package com.aruio.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 性别枚举
 * @Date 2024/9/6 15:26
 * @Created by 10574
 */
@Getter
@AllArgsConstructor
public enum Sex {
    MALE(0, "男"),
    FEMALE(1, "女"),
    UNKNOWN(1, "未知");
    private final Integer code;
    private final String value;

    public static String valueOfCode(Integer code) {
        for (Sex sex : Sex.values()) {
            if (sex.getCode().equals(code)) {
                return sex.getValue();
            }
        }
        return UNKNOWN.getValue();
    }
}
